Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Convert  a  DN  to  this  Format  finance.fabrikam.com-Users  

 Content of Convert a DN to this Format finance.fabrikam.com-Users.vbs
MD5 Hash: BE67E50D0BEFAB8C621E5269439D1EAF
On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

strDN = objUser.distinguishedName

arrDN = Split(strDN, ",")

For i = 0 to UBound(arrDN)
intLength = Len(arrDN(i))
intCounter = intLength - 3
arrDN(i) = Right(arrDn(i), intCounter)
Next

For i = 1 to UBound(arrDN) - 1
strNewName = strNewName & arrDN(i) & "."
Next

intLastItem = UBound(arrDN)
strNewName = strNewName & arrDN(intLastItem) & "/" & arrDN(0)

Wscript.Echo strNewName



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a